import 'package:flutter/material.dart';
import 'package:syria_sports/core/app_export.dart';

import '../presentation/players/add_player_page/bloc/add_player_page_screen.dart';

class AddUserDialog extends StatelessWidget {
  const AddUserDialog({super.key});

  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      shadowColor: Colors.grey,
      elevation: 16,
      backgroundColor: Theme.of(context).colorScheme.secondary,
      title: const Center(
        child: Text(
          'إضافة لاعب',
          style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
        ),
      ),
      content: SizedBox(
        height: 180.v,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          children: [
            Expanded(
              flex: 2,
              child: InkWell(
                onTap:  () {
                  Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => const AddPlayerPageScreen()));
                },
                child: Container(
                  padding:const EdgeInsets.all(4),
                  margin:const EdgeInsets.all(4),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(8),
                    border: Border.all(color: Colors.grey),
                  ),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Expanded(
                        flex: 3,
                        child: Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Image.asset(ImageConstant.icNoteAdd),
                        ),
                      ),
                      Expanded(
                          flex: 2,
                          child: const Text('إضافة لاعب جديد',textAlign: TextAlign.center,)),
                    ],
                  ),
                ),
              ),
            ),
            Expanded(
              flex: 2,
              child: InkWell(
                onTap:  () {
                  // هنا ضع الكود الخاص بإختيار مستخدم مشترك مسبقاً
                  Navigator.of(context).pop();
                },
                child: Container(
                  padding:const EdgeInsets.all(4),
                  margin:const EdgeInsets.all(4),
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(8),
                    border: Border.all(color: Colors.grey),
                  ),
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      Expanded(
                        flex: 3,
                        child: Padding(
                          padding: const EdgeInsets.all(8.0),
                          child: Image.asset(ImageConstant.icNoteAdd),
                        ),
                      ),
                      Expanded(
                          flex: 2,
                          child: const Text('إختيار لاعب مشترك مسبقاً',textAlign: TextAlign.center,)),
                    ],
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
      actions: [
        TextButton(
          onPressed: () {
            Navigator.of(context).pop(); // إغلاق الديالوج
          },
          child: Text('رجوع',style :theme.textTheme.titleMedium),
        ),
      ],
    );
  }
}
